package com.example.demo.repository;

import com.example.demo.model.Klass;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;


public interface KlassRepository extends JpaRepository<Klass, String>{
    List<Klass> findByName(String name);

//    List<Klass> findByNameAndMajor(String name, Integer age);
//
//    List<Klass> findByNameOrMajor(String name, Integer age);
    @Query(nativeQuery = true,value = "select * from student where name = ?1")
    List<Klass> findByNativeQuery(String name);
}

